package com.ztgf.message.model.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.ztgf.message.model.bo.MessageAnnouncementBO;
import com.ztgf.message.model.bo.MessageAnnouncementSaveBO;
import com.ztgf.message.model.dto.MessageAnnouncementDTO;
import com.ztgf.message.model.vo.MessageAnnouncementPageVO;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

/**
 * 公告消息服务
 *
 * @author YUE
 * @Date 2020-05-28 16:20:54
 */
public interface IMessageAnnouncementService extends IService<MessageAnnouncementDTO> {
    boolean insertAllShopsMessage(MessageAnnouncementBO bo, String sessionId);

    boolean add(MessageAnnouncementSaveBO saveBO);

    boolean deletePhById(Long id);

    boolean recoverPhById(Long id);

    boolean updateMessageStatusById(Long id);

    List<MessageAnnouncementDTO> getUnreadMessage(Long shopId, int type);

    boolean updateAllMessageStatusByIds(Long shopId, Integer type, Integer shopType);

    boolean deleteAllMessageStatusByIds(Long shopId, Integer type, Integer shopType);

    boolean deleteSelectMessageById(Long id);

    Page<MessageAnnouncementDTO> getBySelectBannerInfoPage(MessageAnnouncementBO messageAnnouncementBO);

    //@CachePut(cacheNames = "getUnreadMessageNum",key = "#p0 + '-'+ #p1")
    Integer updateUnreadMessageNum(Long shopId, int type, int updateNum);

    @Cacheable(cacheNames = "getUnreadMessageNum", key = "#p0 + '-'+ #p1")
    Integer getUnreadMessageNum(Long shopId, int type);

    Page<MessageAnnouncementDTO> getBySelectPublicMessageInfoPage(MessageAnnouncementBO messageAnnouncementBO);

    boolean deleteLogicById(String ids);

    /**
     * @return : com.baomidou.mybatisplus.plugins.Page<com.ztgf.message.model.vo.MessageAnnouncementPageVO>
     * @Author :chenyu.wang
     * @Description : 后台服务消息列表
     * @Date : 2021.03.10 10:55
     * @Param : [bo]
     **/
    Page<MessageAnnouncementPageVO> queryAdminPageList(MessageAnnouncementBO bo);
}
